package com.itheima;

import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author cp
 * @className UserApp
 * @description TODO
 * @create 2020/12/4 10:58
 **/
public class UserApp {
    public static void main(String[] args) {
        //1. 获取核心容器对象
        ApplicationContext applicationContext = new  ClassPathXmlApplicationContext("applicationContext.xml");

        //2. 获取Service
        //UserService userService = (UserService) applicationContext.getBean("userService");
        UserService userService = applicationContext.getBean(UserService.class);

        userService.save();
    }
}
